package com.headwind.logistics.order.controller;

import com.headwind.logistics.common.util.RestResult;
import com.headwind.logistics.common.util.ResultGenerator;
import com.headwind.logistics.order.entity.OrderAbnormal;
import com.headwind.logistics.order.service.inter.OrderAbnormalServiceInter;
import com.headwind.logistics.order.util.OrderUtil;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.List;

/**
 * @Author 盛夏
 * @Date 2020-07-21 下午 10:13
 * @Version 1.0
 * @DESCRIPTION 异常订单控制器
 */
@RestController
public class OrderAbnormalController {

    @Resource
    private OrderAbnormalServiceInter abnormalServiceInter;

    @Resource
    private ResultGenerator resultGenerator;

    /**
     * 新增异常订单
     * @param goodsIssueTypeId  异常类型ID
     * @param remark    备注
     * @param planOrderOdd  预录单编号
     * @return
     */
    @PostMapping("/admin/abnormal/addAbnormal")
    public RestResult addAbnormal(Long goodsIssueTypeId, String remark,String planOrderOdd){

        return resultGenerator.getSuccessResult(abnormalServiceInter.addOrderAbnormal(goodsIssueTypeId,remark,planOrderOdd));
    }
}
